package cn.edu.zafu.bigdata.mahuilin;

 interface Movable {
    void move();
    void stop();
}

interface Resizable {
    void resize(double factor);
}

class Car2 implements Movable {
    @Override
    public void move() {
        System.out.println("The car is moving.");
    }

    @Override
    public void stop() {
        System.out.println("The car has stopped.");
    }
}

class ResizableCircle implements Movable, Resizable {
    private double radius;

    public ResizableCircle(double radius) {
        this.radius = radius;
    }

    @Override
    public void move() {
        System.out.println("The circle is moving.");
    }

    @Override
    public void stop() {
        System.out.println("The circle has stopped.");
    }

    @Override
    public void resize(double factor) {
        radius *= factor;
        System.out.println("The circle's new radius is: " + radius);
    }
}

public class TestInterface {
    public static void main(String[] args) {
        Car2 car = new Car2();
        ResizableCircle circle = new ResizableCircle(5.0);

        // 验证Car类对Movable接口的实现
        System.out.println("Testing Car:");
        car.move();
        car.stop();

        // 验证ResizableCircle类对Movable和Resizable接口的实现
        System.out.println("\nTesting ResizableCircle:");
        circle.move();
        circle.stop();
        circle.resize(2.0); // 假设缩放因子为2.0
    }
}